var $$ = {
    goPage: function (page, key, val) {
        var search = '?'
        if (typeof key == 'object') {
            for (var prop in key) {
                search += prop + '=' + key[prop] + '&'
            }
            search = search.slice(0, -1)
        } else {
            search += key + '=' + val
        }
        location.href = page + search
    },
    urlGet: function (key) {
        var search = location.search.slice(1)
        var searchArr = search.split('&')
        var searchObj = {}
        
        searchArr.map(function (item) {
            var itemArr = item.split('=')
            searchObj[itemArr[0]] = itemArr[1]
        })

        return key ? searchObj[key] : searchObj
    }
}